package cn.audit.utils;

import java.util.List;

/**
 * 分页工具类
 */
public class PagerUtil {
    //列表数据
    private List dataS;
    //总页数
    private int pageCount;
    //数据总条数
    private int totalCount;
    //当前页
    private int currentPage;
    //每页条数
    private int pageSize = 6;

    public List getDataS() {
        return dataS;
    }

    public void setDataS(List dataS) {
        this.dataS = dataS;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount() {
        if (totalCount % pageSize == 0) {
            this.pageCount = totalCount / pageSize;
        } else {
            this.pageCount = totalCount / pageSize + 1;
        }
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public PagerUtil(List dataS, int pageCount, int totalCount, int currentPage, int pageSize) {
        this.dataS = dataS;
        this.pageCount = pageCount;
        this.totalCount = totalCount;
        this.currentPage = currentPage;
        this.pageSize = pageSize;
    }

    public PagerUtil() {

    }
}
